package com.chixing.day08_interface.word;


public class Order implements Cloneable{
    private String orderName;
    private Product product;
    private int num;

    public Order(){}
    public Order(String orderName, Product product, int num) {
        this.orderName = orderName;
        this.product = product;
        this.num = num;
    }

    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Order cloneorder = new Order();
        cloneorder.orderName = this.orderName;
        cloneorder.product = (Product) this.product.clone();
        cloneorder.num = this.num;
        return cloneorder;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderName=" + orderName +
                ", product=" + product +
                ", num=" + num +
                '}';
    }
}
